import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '创建人',
    align:"center",
    dataIndex: 'createBy'
   },
   {
    title: '创建日期',
    align:"center",
    dataIndex: 'createTime'
   },
   {
    title: '更新人',
    align:"center",
    dataIndex: 'updateBy'
   },
   {
    title: '更新日期',
    align:"center",
    dataIndex: 'updateTime'
   },
   {
    title: '赛事',
    align:"center",
    dataIndex: 'saisId_dictText'
   },
   {
    title: '监听字段',
    align:"center",
    dataIndex: 'saiszd_dictText'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '赛事',
    field: 'saisId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"cdba2_sais,mingc,id"
    },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入赛事!'},
          ];
     },
  },
  {
    label: '监听字段',
    field: 'saiszd',
    component: 'JDictSelectTag',
    componentProps:{
        dictCode:"cdba2_saiszd,zidzwm2,id"
     },
    dynamicRules: ({model,schema}) => {
          return [
                 { required: true, message: '请输入监听字段!'},
          ];
     },
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  createBy: {title: '创建人',order: 0,view: 'text', type: 'string',},
  createTime: {title: '创建日期',order: 1,view: 'datetime', type: 'string',},
  updateBy: {title: '更新人',order: 2,view: 'text', type: 'string',},
  updateTime: {title: '更新日期',order: 3,view: 'datetime', type: 'string',},
  saisId: {title: '赛事',order: 4,view: 'sel_search', type: 'string',dictTable: "cdba2_sais", dictCode: 'id', dictText: 'mingc',},
  saiszd: {title: '监听字段',order: 5,view: 'list', type: 'string',dictTable: "cdba2_saiszd", dictCode: 'id', dictText: 'zidzwm2',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}